﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Freedom.Models.ViewModels;
using Freedom.Models.Interfaces;
using Freedom.Models.Services;
using Freedom.Models;

namespace Freedom.Controllers
{
    /// <summary>
    /// 关于我们控制器
    /// autor: Penn Yao
    /// </summary>
    [HandleError]
    public class AboutController : Controller
    {
        AboutViewModel viewModel;
        IMemberInfoService memberInfoService;

        public AboutController()
        {
            if (viewModel == null)
                viewModel = new AboutViewModel();
            if (memberInfoService == null)
                memberInfoService = new MemberInfoService();
        }

        public ActionResult Index()
        {
            List<tb_MemberInfo> memberInfoList = null;
            if (memberInfoService != null)
                memberInfoList = memberInfoService.getAllInfo().ToList();

            if (viewModel != null)
                viewModel.memberInfoList = memberInfoList;

            return View(viewModel);
        }

        public ActionResult Contact()
        {
            return View();
        }
    }
}
